home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / doc / float.doc < prev    next >
Text File  |  1993-07-05  |  12KB  |  674 lines

  1.  
  2.     FLOAT.DOC (c)Copyright 1990, Matthew Dillon, All Rights Reserved
  3.  
  4. TABLE OF CONTENTS
  5.  
  6. c.lib/float/acos
  7. c.lib/float/asin
  8. c.lib/float/atan
  9. c.lib/float/cos
  10. c.lib/float/exp
  11. c.lib/float/fabs
  12. c.lib/float/log
  13. c.lib/float/log10
  14. c.lib/float/pow
  15. c.lib/float/sin
  16. c.lib/float/sqrt
  17. c.lib/float/tan
  18. c.lib/float/facos
  19. c.lib/float/fasin
  20. c.lib/float/fatan
  21. c.lib/float/fcos
  22. c.lib/float/fexp
  23. c.lib/float/ffabs
  24. c.lib/float/flog
  25. c.lib/float/flog10
  26. c.lib/float/fpow
  27. c.lib/float/fsin
  28. c.lib/float/fsqrt
  29. c.lib/float/ftan
  30.  
  31.  
  32. float/acos                        float/acos
  33. float/facos                        float/facos
  34.  
  35.    NAME
  36.     acos    - return arc cosine of a double quantity
  37.     facos    - return arc cosine of a float quantity
  38.  
  39.    SYNOPSIS
  40.     #include <math.h>
  41.  
  42.     double a = acos(b);
  43.     double b;
  44.  
  45.     float  c = facos(d);
  46.     float  d;
  47.  
  48.    FUNCTION
  49.     Returns the arc cosine of a floating point quantity
  50.  
  51.    EXAMPLE
  52.     /*
  53.      *  compile with the math library -lm
  54.      */
  55.  
  56.     #include <math.h>
  57.     #include <stdio.h>
  58.  
  59.     main()
  60.     {
  61.         {
  62.         double a = acos(0.25);
  63.         printf("acos 0.25 = %lf\n", a);     /*  1.318   */
  64.         }
  65.         {                        /*    less accuracy    */
  66.         float a = facos(0.25);
  67.         printf("acos 0.25 = %lf\n", (double)a);
  68.         }
  69.         return(0);
  70.     }
  71.  
  72.    INPUTS
  73.     double b;    double floating point value
  74.     float  d;    float  floating point value
  75.  
  76.    RESULTS
  77.     double a;    result double floating point value
  78.     float  c;    result float  floating point value
  79.  
  80.    SEE ALSO
  81.     acos, asin, atan, cos, exp, fabs, log, log10, pow, sin, sqrt, tan
  82.     facos, fasin, ...
  83.  
  84.  
  85. float/asin                        float/asin
  86. float/fasin                        float/fasin
  87.  
  88.    NAME
  89.     asin    - return arc sine of a double quantity
  90.     fasin    - return arc sine of a float quantity
  91.  
  92.    SYNOPSIS
  93.     #include <math.h>
  94.  
  95.     double a = asin(b);
  96.     double b;
  97.  
  98.     float  c = fasin(d);
  99.     float  d;
  100.  
  101.    FUNCTION
  102.     Returns the arc sine of a floating point quantity
  103.  
  104.    EXAMPLE
  105.     /*
  106.      *  compile with the math library -lm
  107.      */
  108.  
  109.     #include <math.h>
  110.     #include <stdio.h>
  111.  
  112.     main()
  113.     {
  114.         {
  115.         double a = asin(0.25);
  116.         printf("asin 0.25 = %lf\n", a);     /*  0.2527  */
  117.         }
  118.         {                        /*    less accuracy    */
  119.         float a = fasin(0.25);
  120.         printf("asin 0.25 = %lf\n", (double)a);
  121.         }
  122.         return(0);
  123.     }
  124.  
  125.  
  126.    INPUTS
  127.     double b;    double floating point value
  128.     float  d;    float  floating point value
  129.  
  130.    RESULTS
  131.     double a;    result double floating point value
  132.     float  c;    result float  floating point value
  133.  
  134.    SEE ALSO
  135.     acos, asin, atan, cos, exp, fabs, log, log10, pow, sin, sqrt, tan
  136.     facos, fasin, ...
  137.  
  138.  
  139. float/atan                        float/atan
  140. float/fatan                        float/fatan
  141.  
  142.    NAME
  143.     atan    - return arc tan of a double quantity
  144.     fatan    - return arc tan of a float quantity
  145.  
  146.    SYNOPSIS
  147.     #include <math.h>
  148.  
  149.     double a = atan(b);
  150.     double b;
  151.  
  152.     float  c = fatan(d);
  153.     float  d;
  154.  
  155.    FUNCTION
  156.     Returns the arc tan of a floating point quantity
  157.  
  158.    EXAMPLE
  159.     /*
  160.      *  compile with the math library -lm
  161.      */
  162.  
  163.     #include <math.h>
  164.     #include <stdio.h>
  165.  
  166.     main()
  167.     {
  168.         {
  169.         double a = atan(0.25);
  170.         printf("atan 0.25 = %lf\n", a);     /*  0.245   */
  171.         }
  172.         {                        /*    less accuracy    */
  173.         float a = fatan(0.25);
  174.         printf("atan 0.25 = %lf\n", (double)a);
  175.         }
  176.         return(0);
  177.     }
  178.  
  179.  
  180.    INPUTS
  181.     double b;    double floating point value
  182.     float  d;    float  floating point value
  183.  
  184.    RESULTS
  185.     double a;    result double floating point value
  186.     float  c;    result float  floating point value
  187.  
  188.    SEE ALSO
  189.     acos, asin, atan, cos, exp, fabs, log, log10, pow, sin, sqrt, tan
  190.     facos, fasin, ...
  191.  
  192.  
  193. float/cos                        float/cos
  194. float/fcos                        float/fcos
  195.  
  196.    NAME
  197.     cos    - return cosine of a double quantity
  198.     fcos   - return cosine of a float quantity
  199.  
  200.    SYNOPSIS
  201.     #include <math.h>
  202.  
  203.     double a = cos(b);
  204.     double b;
  205.  
  206.     float  c = fcos(d);
  207.     float  d;
  208.  
  209.    FUNCTION
  210.     Returns the cosine of a floating point quantity
  211.  
  212.    EXAMPLE
  213.     /*
  214.      *  compile with the math library -lm
  215.      */
  216.  
  217.     #include <math.h>
  218.     #include <stdio.h>
  219.  
  220.     main()
  221.     {
  222.         {
  223.         double a = cos(0.25);
  224.         printf("cos 0.25 = %lf\n", a);     /*  0.9689  */
  225.         }
  226.         {                        /*    less accuracy    */
  227.         float a = fcos(0.25);
  228.         printf("cos 0.25 = %lf\n", (double)a);
  229.         }
  230.         return(0);
  231.     }
  232.  
  233.    INPUTS
  234.     double b;    double floating point value
  235.     float  d;    float  floating point value
  236.  
  237.    RESULTS
  238.     double a;    result double floating point value
  239.     float  c;    result float  floating point value
  240.  
  241.    SEE ALSO
  242.     acos, asin, atan, cos, exp, fabs, log, log10, pow, sin, sqrt, tan
  243.     facos, fasin, ...
  244.  
  245.  
  246. float/exp                        float/exp
  247. float/fexp                        float/fexp
  248.  
  249.    NAME
  250.     exp    - return e to the power of the double quantity
  251.     fexp   - return e to the power of the float quantity
  252.  
  253.    SYNOPSIS
  254.     #include <math.h>
  255.  
  256.     double a = exp(b);
  257.     double b;
  258.  
  259.     float  c = fexp(d);
  260.     float  d;
  261.  
  262.    FUNCTION
  263.     Returns e to the power of the floating point quantity
  264.  
  265.    EXAMPLE
  266.     /*
  267.      *  compile with the math library -lm
  268.      */
  269.  
  270.     #include <math.h>
  271.     #include <stdio.h>
  272.  
  273.     main()
  274.     {
  275.         {
  276.         double a = exp(0.25);
  277.         printf("exp 0.25 = %lf\n", a);     /*  1.284   */
  278.         }
  279.         {                        /*    less accuracy    */
  280.         float a = fexp(0.25);
  281.         printf("exp 0.25 = %lf\n", (double)a);
  282.         }
  283.         return(0);
  284.     }
  285.  
  286.    INPUTS
  287.     double b;    double floating point value
  288.     float  d;    float  floating point value
  289.  
  290.    RESULTS
  291.     double a;    result double floating point value
  292.     float  c;    result float  floating point value
  293.  
  294.    SEE ALSO
  295.     acos, asin, atan, cos, exp, fabs, log, log10, pow, sin, sqrt, tan
  296.     facos, fasin, ...
  297.  
  298.  
  299. float/fabs                        float/fabs
  300. float/ffabs                        float/ffabs
  301.  
  302.    NAME
  303.     fabs   - return the absolute value of a double quantity
  304.     ffabs  - return the absolute value of a float quantity
  305.  
  306.    SYNOPSIS
  307.     #include <math.h>
  308.  
  309.     double a = fabs(b);
  310.     double b;
  311.  
  312.     float  c = ffabs(d);
  313.     float  d;
  314.  
  315.    FUNCTION
  316.     Returns the absolute value of a floating point quantity
  317.  
  318.    EXAMPLE
  319.     /*
  320.      *  compile with the math library -lm
  321.      */
  322.  
  323.     #include <math.h>
  324.     #include <stdio.h>
  325.  
  326.     main()
  327.     {
  328.         {
  329.         double a = fabs(-0.25);
  330.         printf("fabs -0.25 = %lf\n", a);     /*  0.25    */
  331.         }
  332.         {                        /*    less accuracy    */
  333.         float a = ffabs(-0.25);
  334.         printf("fabs -0.25 = %lf\n", (double)a);
  335.         }
  336.         return(0);
  337.     }
  338.  
  339.    INPUTS
  340.     double b;    double floating point value
  341.     float  d;    float  floating point value
  342.  
  343.    RESULTS
  344.     double a;    result double floating point value
  345.     float  c;    result float  floating point value
  346.  
  347.    SEE ALSO
  348.     acos, asin, atan, cos, exp, fabs, log, log10, pow, sin, sqrt, tan
  349.     facos, fasin, ...
  350.  
  351.  
  352. float/log                        float/log
  353. float/flog                        float/flog
  354.  
  355.    NAME
  356.     log    - return the log of the double quantity, base e
  357.     flog   - return the log of the float quantity, base e
  358.  
  359.    SYNOPSIS
  360.     #include <math.h>
  361.  
  362.     double a = log(b);
  363.     double b;
  364.  
  365.     float  c = flog(d);
  366.     float  d;
  367.  
  368.    FUNCTION
  369.     Returns the log of the floating point quantity, base e.
  370.  
  371.    EXAMPLE
  372.     /*
  373.      *  compile with the math library -lm
  374.      */
  375.  
  376.     #include <math.h>
  377.     #include <stdio.h>
  378.  
  379.     main()
  380.     {
  381.         {
  382.         double a = log(0.25);
  383.         printf("log 0.25 = %lf\n", a);     /*  -1.3863 */
  384.         }
  385.         {                        /*    less accuracy    */
  386.         float a = flog(0.25);
  387.         printf("log 0.25 = %lf\n", (double)a);
  388.         }
  389.         return(0);
  390.     }
  391.  
  392.    INPUTS
  393.     double b;    double floating point value
  394.     float  d;    float  floating point value
  395.  
  396.    RESULTS
  397.     double a;    result double floating point value
  398.     float  c;    result float  floating point value
  399.  
  400.    SEE ALSO
  401.     acos, asin, atan, cos, exp, fabs, log, log10, pow, sin, sqrt, tan
  402.     facos, fasin, ...
  403.  
  404.  
  405. float/log10                        float/log10
  406. float/flog10                        float/flog10
  407.  
  408.    NAME
  409.     log    - return the log of the double quantity, base 10
  410.     flog   - return the log of the float quantity, base 10
  411.  
  412.    SYNOPSIS
  413.     #include <math.h>
  414.  
  415.     double a = log10(b);
  416.     double b;
  417.  
  418.     float  c = flog10(d);
  419.     float  d;
  420.  
  421.    FUNCTION
  422.     Returns the log of the floating point quantity, base 10.
  423.  
  424.    EXAMPLE
  425.     /*
  426.      *  compile with the math library -lm
  427.      */
  428.  
  429.     #include <math.h>
  430.     #include <stdio.h>
  431.  
  432.     main()
  433.     {
  434.         {
  435.         double a = log10(0.25);
  436.         printf("log10 0.25 = %lf\n", a);     /*  -0.6021 */
  437.         }
  438.         {                        /*    less accuracy    */
  439.         float a = flog10(0.25);
  440.         printf("log10 0.25 = %lf\n", (double)a);
  441.         }
  442.         return(0);
  443.     }
  444.  
  445.    INPUTS
  446.     double b;    double floating point value
  447.     float  d;    float  floating point value
  448.  
  449.    RESULTS
  450.     double a;    result double floating point value
  451.     float  c;    result float  floating point value
  452.  
  453.    SEE ALSO
  454.     acos, asin, atan, cos, exp, fabs, log, log10, pow, sin, sqrt, tan
  455.     facos, fasin, ...
  456.  
  457.  
  458. float/pow                        float/pow
  459. float/fpow                        float/fpow
  460.  
  461.    NAME
  462.     pow    - return one double to the power of another
  463.     fpow   - return one float to the power of another
  464.  
  465.    SYNOPSIS
  466.     #include <math.h>
  467.  
  468.     double a = pow(b, bp);
  469.     double bp;
  470.     double b;
  471.  
  472.     float  c = flog(d, dp);
  473.     float  dp;
  474.     float  d;
  475.  
  476.    FUNCTION
  477.     Returns the power of one fp quantity to another.
  478.  
  479.    EXAMPLE
  480.     /*
  481.      *  compile with the math library -lm
  482.      */
  483.  
  484.     #include <math.h>
  485.     #include <stdio.h>
  486.  
  487.     main()
  488.     {
  489.         {
  490.         double a = pow(0.25, 4.0);
  491.         printf("pow 0.25 ^^ 4.0 = %lf\n", a);     /*  0.0039 */
  492.         }
  493.         {                        /*    less accuracy    */
  494.         float a = fpow(0.25, 4.0);
  495.         printf("pow 0.25 ^^ 4.0 = %lf\n", (double)a);
  496.         }
  497.         return(0);
  498.     }
  499.  
  500.    INPUTS
  501.     double b;    double floating point value (base)
  502.     double bp;    double floating point value (exponent)
  503.     float  d;    float  floating point value (base)
  504.     float  dp;    float  floating point value (exponent)
  505.  
  506.    RESULTS
  507.     double a;    result double floating point value
  508.     float  c;    result float  floating point value
  509.  
  510.    SEE ALSO
  511.     acos, asin, atan, cos, exp, fabs, log, log10, pow, sin, sqrt, tan
  512.     facos, fasin, ...
  513.  
  514.  
  515. float/sin                        float/sin
  516. float/fsin                        float/fsin
  517.  
  518.    NAME
  519.     sin    - return sine of a double quantity
  520.     fsin   - return sine of a float quantity
  521.  
  522.    SYNOPSIS
  523.     #include <math.h>
  524.  
  525.     double a = sin(b);
  526.     double b;
  527.  
  528.     float  c = fsin(d);
  529.     float  d;
  530.  
  531.    FUNCTION
  532.     Returns the sine of a floating point quantity
  533.  
  534.    EXAMPLE
  535.     /*
  536.      *  compile with the math library -lm
  537.      */
  538.  
  539.     #include <math.h>
  540.     #include <stdio.h>
  541.  
  542.     main()
  543.     {
  544.         {
  545.         double a = sin(0.25);
  546.         printf("sin 0.25 = %lf\n", a);     /*  0.2474  */
  547.         }
  548.         {                        /*    less accuracy    */
  549.         float a = fsin(0.25);
  550.         printf("sin 0.25 = %lf\n", (double)a);
  551.         }
  552.         return(0);
  553.     }
  554.  
  555.    INPUTS
  556.     double b;    double floating point value
  557.     float  d;    float  floating point value
  558.  
  559.    RESULTS
  560.     double a;    result double floating point value
  561.     float  c;    result float  floating point value
  562.  
  563.    SEE ALSO
  564.     acos, asin, atan, cos, exp, fabs, log, log10, pow, sin, sqrt, tan
  565.     facos, fasin, ...
  566.  
  567.  
  568. float/sqrt                        float/sqrt
  569. float/fsqrt                        float/fsqrt
  570.  
  571.    NAME
  572.     sqrt   - return the square root of a double quantity
  573.     fsqrt  - return the square root of a float quantity
  574.  
  575.    SYNOPSIS
  576.     #include <math.h>
  577.  
  578.     double a = sqrt(b);
  579.     double b;
  580.  
  581.     float  c = fsqrt(d);
  582.     float  d;
  583.  
  584.    FUNCTION
  585.     Returns the square root of a floating point quantity
  586.  
  587.    EXAMPLE
  588.     /*
  589.      *  compile with the math library -lm
  590.      */
  591.  
  592.     #include <math.h>
  593.     #include <stdio.h>
  594.  
  595.     main()
  596.     {
  597.         {
  598.         double a = sqrt(0.25);
  599.         printf("sqrt 0.25 = %lf\n", a);     /*  0.5000  */
  600.         }
  601.         {                        /*    less accuracy    */
  602.         float a = fsqrt(0.25);
  603.         printf("sqrt 0.25 = %lf\n", (double)a);
  604.         }
  605.         return(0);
  606.     }
  607.  
  608.    INPUTS
  609.     double b;    double floating point value
  610.     float  d;    float  floating point value
  611.  
  612.    RESULTS
  613.     double a;    result double floating point value
  614.     float  c;    result float  floating point value
  615.  
  616.    SEE ALSO
  617.     acos, asin, atan, cos, exp, fabs, log, log10, pow, sin, sqrt, tan
  618.     facos, fasin, ...
  619.  
  620.  
  621. float/tan                        float/tan
  622. float/ftan                        float/ftan
  623.  
  624.    NAME
  625.     tan    - return tan of a double quantity
  626.     ftan   - return tan of a float quantity
  627.  
  628.    SYNOPSIS
  629.     #include <math.h>
  630.  
  631.     double a = tan(b);
  632.     double b;
  633.  
  634.     float  c = ftan(d);
  635.     float  d;
  636.  
  637.    FUNCTION
  638.     Returns the tan of a floating point quantity
  639.  
  640.    EXAMPLE
  641.     /*
  642.      *  compile with the math library -lm
  643.      */
  644.  
  645.     #include <math.h>
  646.     #include <stdio.h>
  647.  
  648.     main()
  649.     {
  650.         {
  651.         double a = tan(0.25);
  652.         printf("tan 0.25 = %lf\n", a);     /*  0.2553  */
  653.         }
  654.         {                        /*    less accuracy    */
  655.         float a = ftan(0.25);
  656.         printf("tan 0.25 = %lf\n", (double)a);
  657.         }
  658.         return(0);
  659.     }
  660.  
  661.    INPUTS
  662.     double b;    double floating point value
  663.     float  d;    float  floating point value
  664.  
  665.    RESULTS
  666.     double a;    result double floating point value
  667.     float  c;    result float  floating point value
  668.  
  669.    SEE ALSO
  670.     acos, asin, atan, cos, exp, fabs, log, log10, pow, sin, sqrt, tan
  671.     facos, fasin, ...
  672.  
  673.  
  674.